package wifiunion.com.notice;


import com.google.gson.reflect.TypeToken;

import java.util.HashMap;

import wifiunion.com.notice.entity.HomePageConfigure;
import wifiunion.com.notice.entity.MessageEntity;
import wifiunion.com.notice.entity.NoticeBackground;
import wifiunion.com.notice.entity.StorageManage;

/**
 * Created by Administrator on 2016/11/23.
 */

public class ConfigureModel implements ConfigureContact.Model {
    @Override
    public void loadData(String url, HashMap<String, Object> params, BaseCallBack callBack) {
        HttpUtils.HttpGetRequest_Asyn(url, params,
                callBack, new TypeToken<HomePageConfigure>() {
                }.getType());
    }

    public void getCommunityNotice(String httpUrlGetNoticeconfigue, HashMap<String, Object> params, BaseCallBack callBack) {

        HttpUtils.HttpGetRequest_Asyn(httpUrlGetNoticeconfigue, params,
                callBack, new TypeToken<MessageEntity>() {
                }.getType());
    }

    public void getStorageConfigue(HashMap<String, Object> params, BaseCallBack callBack) {
        HttpUtils.HttpGetRequest_Asyn(Constants.HTTP_URL_GET_STORAGEMANAGE,params,callBack,new TypeToken<StorageManage>(){}.getType());
    }

    public void updateStorageConfigue(HashMap<String, Object> params, BaseCallBack callBack) {
        HttpUtils.HttpPostRequest_Asyn(Constants.HTTP_URL_POST_UPDATESTORAGEMANAGE,params,callBack,null,false);
    }

    public void getNoticeBackground(HashMap<String, Object> params, BaseCallBack callBack) {
        HttpUtils.HttpGetRequest_Asyn(Constants.HTTP_URL_GET_GETNOTICETIMEBACKGROUND,params,callBack,new TypeToken<NoticeBackground>(){}.getType());
    }

    public void updateNoticeBackground(HashMap<String, Object> params, BaseCallBack callBack) {
        HttpUtils.HttpPostRequest_Asyn(Constants.HTTP_URL_POST_UPDATENOTICETIMEBACKGROUND,params,callBack,null,false);
    }
}
